package com.xuxin.baby.adapter;

import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.xuxin.baby.R;
import com.xuxin.baby.glide.GlideApp;

import org.jetbrains.annotations.NotNull;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by xu_xin
 * Created on 2020.08.21 0021
 */
public class ClassGrowthAdapter extends BaseQuickAdapter<String, BaseViewHolder> {

    public ClassGrowthAdapter() {
        super(R.layout.item_class_growth);
        List<String> list = new ArrayList<>();
        list.add("体格发育监测");
        list.add("目标能力");
        list.add("危险信号");
        list.add("五大能力评估");
        list.add("心理评估");
        setNewInstance(list);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder holder, String item) {
        holder.setText(R.id.item_class_growth_name, item);
        ImageView item_class_growth_image = holder.getView(R.id.item_class_growth_image);
        switch (holder.getAdapterPosition()) {
            case 0:
                GlideApp.with(getContext()).load(R.mipmap.img_class_evalution_control).centerCrop().into(item_class_growth_image);
                break;
            case 1:
                GlideApp.with(getContext()).load(R.mipmap.img_class_evalution_target).centerCrop().into(item_class_growth_image);
                break;
            case 2:
                GlideApp.with(getContext()).load(R.mipmap.img_class_evalution_risk).centerCrop().into(item_class_growth_image);
                break;
            case 3:
                GlideApp.with(getContext()).load(R.mipmap.img_class_evalution_ability).centerCrop().into(item_class_growth_image);
                break;
            case 4:
                GlideApp.with(getContext()).load(R.mipmap.img_class_evalution_mentality).centerCrop().into(item_class_growth_image);
                break;
        }
    }
}